﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Genealogy_Builder
{
    public partial class TraitDialog : Form
    {
        bool pass = true;
        public Trait newTrait;

        public TraitDialog()
        {
            InitializeComponent();
        }

        public bool AddTrait()
        {
            this.ShowDialog();
            return pass;
        }


        private void btnCancel_Click(object sender, EventArgs e)
        {
            pass = false;
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (txtCat.Text == "" || txtName.Text == "")
            {
                MessageBox.Show("Name and Category must have values.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                newTrait = new Trait(txtName.Text, txtCat.Text);
                this.Close();
            }
        }
    }
}
